/**
 * @ author: 汪孟苹
 */
define([],function(){
	var tpl = {};

	tpl.init = function(){
		var html = '';
		html += infoGroup();
		return html;
	} 
	tpl.ruleContentInit = function(){
		var html = '';
		html += ruleContent();
		return html;
	} 

	var infoGroup = function(){
		return 	'<script id="tpl_editMission_infoGroup" type="text/html">'+
				'		<div class="qaCard form-group col-md-6 grid-label-4">'+
				'		    <label for="missionName" class="control-label">宣教名称</label>'+
				'		    <div class="control-input">'+
				'		        <input type="type" class="form-control" id="missionName" name="missionName" value="{{dataInfo.title}}">'+
				'		    </div>'+
				'		</div>'+
				'		<div class="qaCard form-group col-md-6 grid-label-4">'+
				'		    <label for="missionWeight" class="control-label">宣教权重</label>'+
				'		    <div class="control-input">'+
				'		        <input type="type" class="form-control" id="missionWeight" name="missionWeight" value="{{dataInfo.priority}}" placeholder="输入数字 数字越小 权重越大">'+
				'		    </div>'+
				'		</div>'+
				'		<div class="qaCard form-group col-md-6 grid-label-4">'+
				'		    <label class="control-label">推送规则</label>'+
				'		    <div class="control-input">'+
				'		      	<select id="missionPushRule" class="form-control" name="missionPushRule">'+
				'					{{each list as value i}}'+
				'					<option value="{{value.paramCode}}" {{if dataInfo.type==value.paramCode}}selected{{/if}}>{{value.paramName}}</option>'+
				'					{{/each}}'+
				'		      	</select>'+
				'		    </div>'+
				'		</div>'+
				'		<div class="qaCard form-group col-md-6 grid-label-4">'+
				'		    <label class="control-label">规则内容</label>'+
				'		    <div id="missionRuleContent" class="control-input clearfix">'+
				'		    </div>'+
				'		</div>'+
			  	'		<div class="qaCard form-group col-md-12 grid-label-4">'+
				'		    <label class="control-label">LOGO图</label>'+
				'		    <div class="control-input upload-wrap">'+
				'		        <div class="pic"><img id="missionLogo" class="img-responsive center-block" alt="LOGO图" src="{{dataInfo.bannelUrl}}"></div>'+
				'		    	<div class="file-btn">'+
				'		    		<label for="missionLogoUrl">修改</label>'+
				'					<input type="file" id="missionLogoUrl" name="missionLogoUrl" logourl="{{dataInfo.bannelUrl}}">'+
				'		    	</div>'+
				'		    </div>'+
				'		</div>'+
				'</script>';
	}
	var ruleContent = function(){
		return 	'<script id="tpl_editMission_ruleContent" type="text/html">'+
				'			{{if dataInfo.type=="02" || dataInfo.type=="03"}}'+
				'				<div class="grid-range-percent grid-range-age pull-left">'+
				'			      	<input id="ageFrom-year" name="ageFromYear" type="text" class="form-control" placeholder="岁" value="{{dataInfo.ageYearFrom}}">'+
				'			    </div>'+
				'			    <div class="grid-range-percent grid-range-age pull-left">'+
				'			      	<input id="ageFrom-month" name="ageFromMonth" type="text" class="form-control" placeholder="月" value="{{dataInfo.ageMonthFrom}}">'+
				'			    </div>'+
				'			    <div class="grid-range-percent grid-range-age pull-left">'+
				'			      	<input id="ageFrom-day" name="ageFromDay" type="text" class="form-control" placeholder="日" value="{{dataInfo.ageDayFrom}}">'+
				'			    </div>'+
				'			    <div class="grid-range-i"><i>-</i></div>'+
				'			    <div class="grid-range-percent grid-range-age pull-right">'+
				'			      	<input id="ageTo-day" name="ageToDay" type="text" class="form-control" placeholder="日" value="{{dataInfo.ageDayTo}}">'+
				'			    </div>'+
				'			    <div class="grid-range-percent grid-range-age pull-right">'+
				'			      	<input id="ageTo-month" name="ageToMonth" type="text" class="form-control" placeholder="月" value="{{dataInfo.ageMonthTo}}">'+
				'			    </div>'+
				'			    <div class="grid-range-percent grid-range-age pull-right">'+
				'			      	<input id="ageTo-year" name="ageToYear" type="text" class="form-control" placeholder="岁" value="{{dataInfo.ageYearTo}}">'+
				'			    </div>'+
				'			{{else if dataInfo.type=="01" || dataInfo.type=="04"}}'+
				'		        <input type="type" class="form-control" id="missionRuleContent" name="missionRuleContent" value="{{dataInfo.pushRule}}" readonly>'+
				'			{{else if dataInfo.type=="05"}}'+
				'			    <div class="grid-range-percent grid-range-time pull-left">'+
				'			      	<input id="timeFrom" name="timeFrom" type="text" class="form-control" placeholder="天数" value="{{dataInfo.timeFrom}}">'+
				'			    </div>'+
				'			    <div class="grid-range-i"><i>-</i></div>'+
				'			    <div class="grid-range-percent grid-range-time pull-right">'+
				'			      	<input id="timeTo" name="timeTo" type="text" class="form-control" placeholder="天数" value="{{dataInfo.timeTo}}">'+
				'			    </div>'+
				'			{{else}}'+
				'		        <input type="type" class="form-control" id="missionRuleContent" name="missionRuleContent" value="{{dataInfo.pushRule}}">'+
				'			{{/if}}'+
				'</script>';
	}
	
	return tpl;
});